home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Testing & Debugging / Virtual User / Virtual User Current Release / Examples / External Tool Templates / CPlus Tool Template / AERequest.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-04  |  2.3 KB  |  93 lines  |  [TEXT/MPS ]

  1. /*
  2.  *    File:        AERequest.h
  3.  *
  4.  *    Contains:    xxx put contents here xxx
  5.  *
  6.  *    Written by:    Rick Violet
  7.  *
  8.  *    Copyright:    © 1992 by Apple Computer, Inc., all rights reserved.
  9.  *
  10.  *    Change History (most recent first):
  11.  *
  12.  *        <4+>    11/19/92    RV        
  13.  *                11/18/92    RV        xxx put comment here xxx
  14.  *
  15.  *    To Do:
  16.  */
  17.  
  18. #ifndef __AERequest__
  19. #define __AERequest__
  20.  
  21. //class AERequest;
  22.  
  23. #ifndef        __Request__
  24. #include        "Request.h"
  25. #endif
  26.  
  27. #ifndef        __APPLEEVENTS__
  28. #include        <AppleEvents.h>
  29. #endif
  30.  
  31. pascal    OSErr  
  32. AERequestHandler( AppleEvent* pMessage, AppleEvent* pReply, long );
  33.  
  34. //—————————————————————————————————————————————————————————————————————————————————————
  35. //    AERequest class -    represents the service request from the V.U. script
  36. //        This request is generated upon receiving a 'v.u.' 'extc' AppleEvent
  37. //—————————————————————————————————————————————————————————————————————————————————————
  38. class AERequest : public Request
  39. {
  40.     AppleEvent        fMessage;
  41.     AppleEvent*        fMessagePtr;
  42.  
  43.     AppleEvent        fReply;
  44.     AppleEvent*        fReplyPtr;
  45.  
  46.     Boolean            fSuspended;
  47.     AppleEvent        fResetTimerMsg;
  48.     Boolean            fHaveResetTimerMsg;
  49.     long            fReturnID;
  50.     
  51.     Boolean            fUseStandardReplyType;    //———— standard = AppleScript (also VU 2.1)
  52.     
  53. public:        //———————————————————————
  54.                         AERequest( AppleEvent* pMessage, AppleEvent* pReply, 
  55.                                     Boolean pUseModernReplyType = true );                        
  56. virtual                    ~AERequest();
  57.  
  58.         long            GetIdentifierOfRequesttoCancel();
  59.  
  60. static    OSErr            InstallAppleEventHandler();
  61.  
  62.         void            SetErrorCode( OSErr tErr );
  63.         void            SetErrorMessage( char* tErrText );
  64.  
  65.         OSErr            Initialize();
  66.         OSErr            SetupReturnID();
  67.         OSErr            SetupSeviceIdentifier();
  68.         OSErr            SetupParameterList();
  69.         OSErr            SetupRequestIdentifier();
  70.  
  71.         OSErr            MakeVUListFromDescList( AEDescList*    pDescList, 
  72.                                                 VUList**    pValue );
  73.  
  74.         void            ResetTimeOutCounter( unsigned long pNewTimeOutInterval = kDefaultTimeOutSeconds );
  75.         OSErr            SendTimeOutResetMessage( unsigned long pNewTimeOutInterval );
  76.  
  77. virtual    void            SendResult();
  78. virtual    OSErr            PutReturnValueIntoReplyEvent();
  79.  
  80.         OSErr            MakeDescListFromVUList( VUList*        pValue,
  81.                                                 AEDescList*    pDescList );
  82.  
  83.         /*SBR Hacked this in 12/03/94 for compatibility with VU 2.0.x */
  84.         Boolean            UseStandardReplyType() { return fUseStandardReplyType; };
  85.  
  86.         /*SBR Hacked this in 12/03/94 to fix an (alleged) AE Manager bug */
  87.         void            FixAEManagerBugPart1();
  88.  
  89. };
  90.  
  91.  
  92. #endif
  93.